<script lang="tsx">
import { oSearch } from 'oneui'

export default defineComponent({
  components: { oSearch },
  setup() {
    const formData = reactive({})
    provide('formData', formData)
    const eventData = reactive({})
    provide('eventData', eventData)
    const searchOptions = computed(() => {
      return {
        columns: [
          {
            prop: 'username',
            comtype: 'input',
            placeholder: '请输入用户账号',
            slots: {
              append() {
                return (
                  <el-tooltip
                    content={'用户账号,批量用英文逗号(,)分割'}
                    placement="top"
                  >
                    <el-icon>
                      <question-filled />
                    </el-icon>
                  </el-tooltip>
                )
              }
            }
          },
          {
            prop: 'agent',
            placeholder: '请输入直属分组',
            comtype: 'input'
          },
          {
            prop: 'status',
            placeholder: '请输入在线状态',
            comtype: 'select',
            options: [
              { label: 'PC在线', value: 1 },
              { label: 'WAP在线', value: 2 },
              { label: 'APP在线', value: 3 }
            ]
          },
          {
            prop: 'accountstatus',
            placeholder: '请选择账号状态',
            comtype: 'select',
            options: [
              { label: '启用', value: 1 },
              { label: '停用', value: 2 }
            ]
          },
          {
            prop: 'tag',
            placeholder: '请选择用户标记',
            comtype: 'select',
            multiple: true,
            collapseTags: true,
            options: [
              { label: '正常', value: 1 },
              { label: '危险', value: 2 },
              { label: '致命', value: 3 },
              { label: '测试', value: 4 }
            ]
          },
          {
            prop: 'truename',
            placeholder: '请输入真实姓名',
            comtype: 'input'
          },
          {
            prop: 'usergroup',
            placeholder: '请选择用户分组',
            comtype: 'select',
            multiple: true,
            collapseTags: true,
            options: [
              { label: '分组1', value: 1 },
              { label: '分组2', value: 2 },
              { label: '分组3', value: 3 },
              { label: '分组4', value: 4 }
            ]
          },
          {
            prop: 'bankno',
            placeholder: '请输入身份ID号',
            comtype: 'input'
          },
          {
            prop: 'paytype',
            placeholder: '请选择支付类型',
            comtype: 'select',
            multiple: true,
            collapseTags: true,
            options: [
              { label: '分组1', value: 1 },
              { label: '分组2', value: 2 },
              { label: '分组3', value: 3 },
              { label: '分组4', value: 4 }
            ]
          },
          {
            prop: 'ip',
            placeholder: '请输入登录IP',
            comtype: 'input'
          },
          {
            prop: 'regip',
            placeholder: '请输入注册ip',
            comtype: 'input'
          },
          {
            prop: 'regtime',
            placeholder: '请输入注册时间',
            comtype: 'datepicker',
            type: 'daterange',
            startPlaceholder: '注册开始日期',
            endPlaceholder: '注册结束日期'
          }
        ]
      }
    })
    return () => (
      <div>
        <oSearch searchOptions={searchOptions}></oSearch>
      </div>
    )
  }
})
</script>
